package com.iptv.grape.bu.imp;


import android.view.KeyEvent;

import com.iptv.grape.BaseActivity;
import com.iptv.grape.bu.AppConfig;
import com.iptv.grape.bu.AppState;
import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.bu.IKeyEventPorc;
import com.iptv.grape.video.XMediaPlayer;
// 显示相关推荐或者直接退出全屏
@AppState(isShowLiveMenu = false,keyVals = {4})
public class ShowRecommand implements IKeyEventPorc {
    @Override
    public void onKeyDownEvent(BaseActivity context, XMediaPlayer mediaPlayer, GrapeContext grapeContext, KeyEvent event) {
        if(AppConfig.getAppConfig().isCanShowLiveRecommend()) {
            grapeContext.loadRecommendFragment(context);
        }
        else {
            // 直接返回
            QuitFullScreen.quitFullScreen(context);
        }
    }
}
